<?php
$this->title = "邮轮销售列表";
?>

<?= yii\web\View::registerCssFile("/css/front/order-list.css",['depends' => 'app\assets\MuiAsset']) ?>

<style type="text/css">
	.text-center{text-align: center;}
	.mui-pagination>li>a, .mui-pagination>li>span{color: #a664a6;}
    .mui-pagination>li.mui-active>a, .mui-pagination>li.mui-active>a:active, .mui-pagination>li.mui-active>span, .mui-pagination>li.mui-active>span:active, .mui-pagination>li:active>a, .mui-pagination>li:active>a:active, .mui-pagination>li:active>span, .mui-pagination>li:active>span:active{border-color: #a664a6;background-color: #a664a6;}	
</style>

<?php foreach($model as $val){ ?>

	<div class="section container-fluid">
			<div class="header">
				<p class="header-l"><?=$val->product->name?></p>
				<p class="header-r ze"><?=$val->product->go_time?></p>
			</div>
			<div class="state">
				<div class="state-l">
					<p>状态：　<span class="ze"><?=yii::$app->params['order_status'][$val->status]?></span></p>
					<p>销售：　<?= isset($val->member->id) ? $val->member->profile->name : '(未设置)'  ?></p>
					<p>订单号： <?=$val->code?></p>
					<p>创建时间： <?=Yii::$app->formatter->asDate($val->created_at)?></p>
					<p>更新时间： <?=Yii::$app->formatter->asRelativeTime($val->updated_at)?></p>
				</div><div class="state-r">
					<p class="ze"><?= empty($val->assign_id) ? '未分团' :  $val->assign->name ?></p>
					<p>舱房金额：　<span class="ct"><?=Yii::$app->formatter->asCurrency($val->total_sale)?></span></p>
					<p>优惠金额：　<span class="ct"><?=Yii::$app->formatter->asCurrency($val->sale_price)?></span></p>
					<p>附&nbsp; 加&nbsp; 费：　<span class="ct"><?=Yii::$app->formatter->asCurrency($val->priceSum)?></span></p>
					<p>总&nbsp; 金&nbsp; 额：　<span class="je"><?=Yii::$app->formatter->asCurrency($val->price)?></span></p>
				</div>
			</div>
			<div class="info">
			<?php foreach($val->room as $mk=>$room){ ?>	
				<?php if($val->product->stock == 1) {?> 

				<div>
					<p class="info-l"><?= $room->productRoom->room->name?><?= $room->productRoom->room->code ?> <?= $room->productRoom->people ?>人间</p>
					<p class="info-r">已录入<?=$val->getRoomCustomer($room->id)->count()?>人</p>
				</div>
				<?php }elseif($val->product->stock == 2){ ?>
					<?php $t = json_decode($val->product->rooms, true);?>
					<?php foreach($val->room as $room){  ?>
					<div>
						<p class="info-l"><?=$t[$room->room_id]['name']?></p>
						<p class="info-r">已录入<?=$val->getRoomCustomer($room->id)->count()?>人</p>
					</div>
					<?php }?>
				<?php }?>
			<?php }?>	
			</div>		
	</div>


<?php }?>

	<div class="mui-content-padded text-center">
                  
             <?= yii\widgets\LinkPager::widget(['pagination' => $pages,'lastPageLabel'=>false, 'firstPageLabel'=>false,'maxButtonCount'=>5,'activePageCssClass'=>'mui-active','disabledPageCssClass'=>'mui-disabled','nextPageLabel' => false,
'prevPageLabel' => false,'options'=>['class'=>'mui-pagination']]); ?>
        </div>

